package com.hx.voice.recognition.common.msg;

import java.util.List;

/**
 * @descripe：
 * @company：南京华讯方舟通讯设备有限公司
 * @author：zhoujinbing
 * @time：2019/6/12 14:38
 * @version：V1.0
 */
public class TableResultResponse<T> extends BaseResponse {

    TableData<T> data;

    public TableResultResponse(long total,List<T> rows)
    {
        this.data = new TableData<>(total,rows);
    }

    public TableResultResponse()
    {
        this.data = new TableData<>();
    }

    TableResultResponse<T> total(int total)
    {
        this.data.setTotal(total);
        return this;
    }

    TableResultResponse<T> total(List<T> rows)
    {
        this.data.setRows(rows);
        return this;
    }

    public TableData<T> getData()
    {
        return this.data;
    }

    public void setData(TableData<T> data)
    {
        this.data = data;
    }


    class TableData<T>
    {
        long total;
        List<T> rows;

        public TableData(long token, List<T> rows) {
            this.total = token;
            this.rows = rows;
        }

        public TableData() {
        }

        public long getTotal() {
            return total;
        }

        public void setTotal(long total) {
            this.total = total;
        }

        public List<T> getRows() {
            return rows;
        }

        public void setRows(List<T> rows) {
            this.rows = rows;
        }
    }


}